package com.twu.biblioteca;

public class ReturnItemCommand implements Command {
    private final Library library;

    public ReturnItemCommand(Library library) {
        this.library = library;
    }

    public String call(Object[] arguments) {
        boolean successfulReturn = library.returnItem(arguments[0].toString());
        if (successfulReturn) {
            return "Thank you for returning the book.\n";
        }
        return "That is not a valid book to return.\n";
    }
}